-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added equals/hashcode method to register statewatcher once #154
Conversation
I'm curious, do you find something deficient in #151 that motivated the creation of this PR? |
Statewatcher is tracked at zkclient level in hashmap. Now with equal and hashcode we will only one statewatcher at client. I would run your test case and observe the difference |
@hiteshk25 interesting! I have never thought of controlling it in a lower level with such a simple change! 😊 I agree with that the existing code is actually odd as @magibney pointed out (free floating StateWatcher, hence the "passive" removal). Even with this change, I raised the same question of how does this solution work - It does take quite a bit of digging into the code (and not entirely obvious at all!)... that Considering the scope of a single On the other end, if there are multiple |
ha, sure enough! This is actually leaning on ZooKeeper code (nothing in Solr) to dedupe these watches. Honestly I'd be inclined to add In this case it's the right thing to do, but I'm still thinking through the implications, and whether it makes sense alone or complementary to the changes in #151. |
^ this. The "gotcha" here is: currently, within the scope of a ZkStateReader, But aside from 3rd-party backcompat concerns, IMO the singleton logic is clear when the deduping is kept directly within the |
No description provided.